﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace 设计模式.备忘录模式
{
    public class Originator
    {
        public string State { set; get; }

        public Memento SaveStateToMemento()
        {
            return new Memento(State);
        }

        public void GetStateToMemento(Memento memento)
        {
            State = memento.state;
        }

        internal void GetStateFromMemento(object p)
        {
            throw new NotImplementedException();
        }
    }
}
